
using QdbUnit;
using QdbUnit.Extensions;
using Qdb.IO;
using Qdb.Tests.Common.Api;

namespace Qdb.Tests.Common.IO
{
	public class RandomAccessFileStorageFactoryTestCase : TestWithTempFile
	{
		private readonly IStorage subject = QdbUnitPlatform.NewPersistentStorage();

		public virtual void TestExistsWithUnexistentFile()
		{
			Assert.IsFalse(subject.Exists(TempFile()));
		}

		public virtual void TestExistsWithZeroLengthFile()
		{
			IBin storage = subject.Open(new BinConfiguration(TempFile(), false, 0, false));
			storage.Close();
			Assert.IsFalse(subject.Exists(TempFile()));
		}
	}
}
